﻿
GY.Bill.ConsultList = {
    //获取列表信息
    GetConsultList: function () {
        var $divMain = $("#div_offer_list");
        var pageIndex = (($divMain.attr("data-pageIndex")) / 1) + 1;

        $.ajax({
            type: "Post",
            url: $divMain.attr("data-url"),
            data: { pageIndex: pageIndex },
            dataType: "html",
            success: function (result) {
                if (result != "") {
                    $divMain.attr("data-pageIndex", pageIndex);

                    $divMain.append(result);
                }
            }
        });
    }
};
(function () {
    $(function () {
        $(function () {
            //滚动条到底事件
            $(window).scroll(function () {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(document).height();
                var windowHeight = $(this).height();
                if (scrollTop + windowHeight == scrollHeight) {
                    GY.Bill.ConsultList.GetConsultList();
                }
            });

            // 向上滑动事件 没有滚动条时使用此方法翻页
            $("body").swipeUp(function(e) {
                GY.Bill.ConsultList.GetConsultList();
            });

            $("#menuOffer").addClass("active");
        });
    });
})();

